package com.ship.dispatch.service.orderPay;

import com.ship.common.core.base.Constant;
import com.ship.common.business.service.BaseService;
import com.ship.dispatch.bean.orderPay.SpFundManage;
import com.ship.dispatch.bean.orderPay.SpPaymentOrder;
import com.ship.dispatch.bean.orderPay.SpPaymentOrderDetail;
import com.ship.dispatch.bean.sys.SysConstant;
import com.ship.dispatch.model.dto.orderPay.SpPaymentOrderDetailDto;
import com.ship.dispatch.bo.orderPay.SpPaymentOrderBO;
import com.ship.dispatch.bo.orderPay.SpPaymentOrderDetailBO;
import com.ship.dispatch.model.dto.orderPay.SpPaymentOrderDto;
import com.ship.dispatch.vo.orderPay.*;

import java.math.BigDecimal;
import java.util.List;

public interface SpPaymentOrderService extends BaseService<SpPaymentOrder> {

    /**
     * 根据航次号和订单类型获取上传发票时间
     * @param dispatchSchemeExecuteId 航次号id
     * @param orderType 订单类型id
     * @param contractId 合同id
     * @return
     */
    String getInvoiceTime(Long dispatchSchemeExecuteId,Integer orderType,Long contractId);

    /**
     * 获取字典表类型
     * @param labelName 名称
     * @return
     */
    List<SysConstant> getConstantsByType(String labelName);

    /**
     * 获取订单类型
     * @param labelName 名称
     * @return
     */
    List<OrderTypesVO> getOrderTypes(String labelName);

    /**
     * 获取航次号
     * @return
     */
    List<SpDispatchSchemeExecuteVO> getVoyageNos();

    /**
     * 获取合同集合
     * @return
     */
    List<ContractsVO> getContracts(Integer constValue);

    /**
     * 新增订单
     *
     * @param spPaymentOrderDto 订单dto
     * @return
     */
    Boolean savePayOrder(SpPaymentOrderDto spPaymentOrderDto);

    /**
     * 删除支付结算
     * @param id
     * @return
     */
    Boolean removePayOrder(Long id);

    /**
     * 查询支付结算列表
     * @return
     */
    List<SpPaymentOrderVO> getPayOrders();

    SpPaymentOrderDetailVO getSpPaymentOrderDetail(Long orderId);

    SpPaymentOrderDetailVO updateSpPaymentOrderDetail(SpPaymentOrderDetailDto paymentOrderDetailDto);

    SpPaymentOrder synchronousPayOrder(SpPaymentOrderBO paymentOrderBO);

    SpPaymentOrderDetail synchronousPayOrderDetail(SpPaymentOrderDetailBO orderDetailBO);

    public void synchronousSpFundManageDetail(SpPaymentOrderDetail spPaymentOrderDetail, Long fundManageId, BigDecimal accountBalance);
    public SpFundManage synchronousSpFundManage(SpPaymentOrder paymentOrder, SpPaymentOrderDetail spPaymentOrderDetail);

    void removePayFundManagement(Long orderId);
}
